{extend name="common/userbase"} 
{block name="title"}
<title>用户订单</title>
{/block}
{block name="content"}
<!--用户中心(积分)-->
<div class="user_style clearfix" id="user">
    <div class="user_title"><em></em>用户中心</div>
      <div class="clearfix user" >
      <!--左侧菜单栏样式-->
      <div class="user_left">
          <div class="user_info">
           <div class="Head_portrait"><img src="__STATICS__/images/people.png"  width="80px" height="80px"/><!--头像区域--></div>
           <div class="user_name">{:session('nickname')}<a href="#">[个人资料]</a></div>
          </div>
          <ul class="Section">
           <li><a href="{:url('user/center')}"><em></em><span>我的特色馆</span></a></li>
           <li><a href="{:url('user/info')}"><em></em><span>完善个人信息</span></a></li>
           <li><a href="{:url('user/password')}"><em></em><span>修改密码</span></a></li>
           <li><a href="{:url('user/orders')}"><em></em><span>我的订单</span></a></li>
           <li><a href="{:url('user/message')}"><em></em><span>我的评论</span></a></li>
           <li><a href="{:url('user/integral')}"><em></em><span>我的积分</span></a></li>
           <li><a href="{:url('user/collect')}"><em></em><span>我的收藏</span></a></li>
           <li><a href="{:url('user/address')}"><em></em><span>收货地址管理</span></a></li>
          </ul>
        </div>
        <!--右侧内容样式-->
         <div class="right_style r_user_style">
          <div class="user_Borders">
          <div class="title_name">
            <span class="name">用户积分</span>
           </div>
           <!--积分样式-->
           <div class="user_integral_style slideTxtBox">
             <div class="hd">
              <ul>
               <li>您的订单状态</li>
              </ul>
             </div>
             <div class="bd">
               <ul>
                <table>
                 <thead>
                   <tr>
                    <td>订单号</td>
                    <td>订单金额</td>
                    <td>生成订单日期</td>
                    <td>订单状态</td>
                   </tr>
                 </thead>
                 <tbody>
                  {foreach name="orders" id="val"}
                  <tr>
                    <td>{$val.orders}</td>
                    <td>￥{$val.total}.00</td>
                    <td>{$val.inputtime}</td>
                    <td class="state">{$val.state}</td>
                  </tr>
                {/foreach}
                 </tbody>
                </table>
               </ul>
             </div>
           </div>
           <script>jQuery(".slideTxtBox").slide({trigger:"click"});</script>
           <script>
              $('.state').each(function(i){
                var state = $('.state').eq(i).text();
                if (state == "待支付") {
                  $('.state').eq(i).html(state+'(<a href="{:url("product/page")}">支付订单</a>/<a href="{:url("user/delorders")}?orders={$val.orders}">取消订单</a>)')
                }else if (state == "待发货") {
                  $('.state').eq(i).html(state+'(<a href="{:url("user/delorders")}?orders={$val.orders}">取消订单</a>)')
                }else{
                  $('.state').eq(i).html(state)
                }
              })
           </script>
          </div>
         </div>    
      </div>
    </div>
{/block}
<a href="">支付订单</a>/<a href="">取消订单</a>